<template>
  <div>
    <el-dialog title="商品规格" :visible.sync="visible">
      <el-tag class="type-tag" >
        {{spec}}
      </el-tag>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data () {
    return {
      visible: false,
      spec: '',
      loading: ''
    }
  },
  methods: {
    init (prospecId) {
      this.loading = this.$loading({ text: '加载中...' })
      this.$http.get('/goods/info/spec/' + prospecId).then(data => {
        this.loading.close()
        if (data.code === 0) {
          this.visible = true
          this.spec = data.goodsPack
        } else {
          this.$alert(data.msg, {
            type: 'error'
          })
        }
      })
    }
  }
}
</script>

<style scoped>
.type-tag{
  margin: 5px;
}
</style>
